package org.ranshiyan.service.impl;

import org.ranshiyan.dao.UserDao;
import org.ranshiyan.model.User;
import org.ranshiyan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

import javax.servlet.http.Cookie;
import java.util.List;

@Service
public class UserServiceimpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> zlist() {
        List<User> zlist = userDao.zlist();
        return zlist;
    }

    @Override
    public boolean updsum() {
        return userDao.updsum();
    }

    @Override
    public User selone(Integer id) {
        return userDao.selectById(id);
    }

    @Override
    public boolean login(User user) {
        Cookie cookie = new Cookie("name","30");
        cookie.setValue("session id");
        return userDao.login(user);
    }

    @Override
    public void proxy() {
        System.out.println("动态代理");
    }


}
